/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package gestion;
import java.sql.*;


public class connexion {
    
    String urlPilote ="com.mysql.jdbc.driver";
    String urlBaseDonnee = "jdbc:mysql://localhost:3306/gestiondesnotes" ;
    Connection conn;
     public connexion(){
     try {
    Class.forName(urlPilote);
            
}
   catch(ClassNotFoundException ex){
    System.out.println(ex);
    
}
     try{
         conn= DriverManager.getConnection(urlBaseDonnee,"root","");
     }
     catch(SQLException ex){
         
             System.out.println(ex);
    
     }
}
     Connection ObtenirConnexion(){
    return conn ;
}
}
